﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MediaAutomatorLib.MediaOrganizer
{
    public class DirectoryNode
    {
        public String Path { get; set; }

        public override int GetHashCode()
        {
            return Path.GetHashCode();
        }

        public override bool Equals(object obj)
        {
            var directoryNode = obj as DirectoryNode;
            if (directoryNode == null)
                return base.Equals(obj);
               
            string path1 = Path;
            string path2 = directoryNode.Path;

            if (!path1.EndsWith("\\"))
                path1 += "\\";

            if (!path2.EndsWith("\\"))
                path2 += "\\";
            
            
            return path1.Equals(path2);
            
        }
    }
}
